import { defineComponent, ref } from 'vue'

export default defineComponent({
  name: 'demo',
  emits: ['clickName'],
  props: {
    title: {
      type: String,
      default: 'demo',
    },
  },
  setup(props, ctx) {
    const { slots, emit } = ctx
    const hi = ref('hi!')
    return () => (
      <>
        <div>{hi.value}</div>
        <div
          onClick={() => {
            emit('clickName', props.title)
          }}
        >
          {props.title}
        </div>
      </>
    )
  },
})
